package com.corpgovernment.organization.model.login;

import com.corpgovernment.api.basic.constraints.ListRange;
import com.corpgovernment.api.basic.enums.SourceEnum;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 用户登录vo
 *
 * @author jhxue
 */
@Data
public class UserLoginVo implements Serializable {


	private static final long serialVersionUID = 9190505191061661132L;

	/**
	 * 用户id
	 */
	private String uid;
	/**
	 * uuid
	 */
	private String uuid;
	/**
	 * 用户名
	 */
	private String userName;

	@NotBlank(message = "请填写对应信息", groups = {SmsLoginValid.class, FindPwdValid.class, SendLoginMsgCodeValid.class,
			SendRegisterMsgCodeValid.class, SendFindPwdMsgCode.class, FindPwdMsgCodeValid.class})
	private String phoneNum;

	/****/
	private String email;
	/**
	 * 账号
	 */
	@NotBlank(message = "请填写对应信息", groups = {AccountLoginValid.class})
	private String accountName;
	/**
	 * 密码
	 */
	@NotBlank(message = "请填写对应信息", groups = {AccountLoginValid.class, UpdatePwdByOriginPwdValid.class})
	private String pwd;
	/**
	 * 密码(new)
	 */
	@NotBlank(message = "请填写对应信息", groups = {FindPwdValid.class, UpdatePwdByOriginPwdValid.class})
	private String newPwd;
	/**
	 * 验证码
	 **/
	@NotBlank(message = "请填写对应信息", groups = {SmsLoginValid.class, FindPwdValid.class, FindPwdMsgCodeValid.class})
	private String msgCode;
	/**
	 * 来源
	 */
	@ListRange(message = "来源不合法", groups = {SmsLoginValid.class, AccountLoginValid.class, FindPwdValid.class,
			GetUserInfoByTokenValid.class, UpdatePwdByOriginPwdValid.class, LogoutValid.class,
			SendLoginMsgCodeValid.class, SendRegisterMsgCodeValid.class, SendFindPwdMsgCode.class,
			FindPwdMsgCodeValid.class}, list = SourceEnum.class)
	private String source;
	/**
	 * 系统版本
	 */
	private String osVersion;
	/**
	 * 设备id
	 */
	private String deviceId;

	/**
	 * 国家码
	 */
	@NotBlank(message = "请填写对应信息", groups = {SmsLoginValid.class, FindPwdValid.class, SendLoginMsgCodeValid.class,
			SendRegisterMsgCodeValid.class, SendFindPwdMsgCode.class, FindPwdMsgCodeValid.class})
	private String countryCode;

	/**
	 * token
	 **/
	@NotBlank(message = "token不能为空", groups = {GetUserInfoByTokenValid.class, UpdatePwdByOriginPwdValid.class,
			LogoutValid.class})
	private String token;
	/**
	 * 证件号
	 */
	private String cardNo;
	/**
	 * 启停用
	 */
	private Boolean enabled;

	/**
	 * 是否后台用户
	 */
	private Boolean isBgUser;

	public interface AccountLoginValid {
	}

	public interface SmsLoginValid {
	}

	public interface FindPwdValid {
	}

	public interface GetUserInfoByTokenValid {
	}

	public interface UpdatePwdByOriginPwdValid {
	}

	public interface LogoutValid {
	}

	public interface SendLoginMsgCodeValid {
	}

	public interface SendRegisterMsgCodeValid {
	}

	public interface SendFindPwdMsgCode {
	}

	public interface FindPwdMsgCodeValid {
	}
}
